package cn.sdjzu.exercise.myview;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class Ball extends View {
	
	public Ball(Context context, AttributeSet attrs) {
		super(context, attrs);
		cx = 400;
		cy = 299;
	}

	private int cx;
	public int cy;
	public static int change =0;

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		Paint paint = new Paint();
		paint.setColor(Color.GREEN);
		if(change==1){
			paint.setColor(Color.RED);
		} 
		canvas.drawCircle(cx, cy, 15, paint);
	}
}


